package test.study.concurrent.thread._7_fork_join;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;

@Slf4j
public class _2_ForkJoin_Main {

    private static final ForkJoinPool POOL = new ForkJoinPool(10);

    public static void main(String[] args) {
        log.info("main thread");

        POOL.execute(() -> {
            log.info("sub thread");
        });
        log.info("size= {}", POOL.getStealCount());

        ThreadUtil.sleep(3, TimeUnit.SECONDS);
    }
}
